package com.itheima.controller;

import com.itheima.anno.Log;
import com.itheima.common.R;
import com.itheima.dto.EmpLoginDto;
import com.itheima.service.EmpService;
import com.itheima.vo.LoginVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/login")
public class LoginController {
    @Autowired
    EmpService empService;

    @PostMapping
    public R login(@RequestBody EmpLoginDto empLoginDto) {
        LoginVo loginVo = empService.login(empLoginDto);
        return R.ok(loginVo);
    }
}
